package br.panthro.media.sound
{
	import flash.display.Sprite;
	import flash.media.Sound;
	import flash.media.SoundChannel;
	import flash.media.SoundTransform;
	import flash.net.URLRequest;
	
	public class SoundManager extends Sprite
	{
		
		private var _sound:Sound;
		private var _channel:SoundChannel;
		
		public function SoundManager()
		{
			super();
		}
		
		public function setSound(soundPath:String):void
		{
			_channel = new SoundChannel();
			_sound = new Sound();
			_sound.load(new URLRequest(soundPath));
			_channel = _sound.play(0,99);
			
		} 
		public function set volume(vol:Number):void
		{
			var st:SoundTransform = new SoundTransform();
			st.volume = vol;
			_channel.soundTransform = st;
		}
	}
}